Skip to content

Refactor to use context.app API instead of global state#1

Merged
isamu merged 1 commit intomainfrom
context-api
Jan 20, 2026
Merged

Refactor to use context.app API instead of global state#1
isamu merged 1 commit intomainfrom
context-api

Conversation

@isamu
Copy link
Copy Markdown
Contributor

@isamu isamu commented Jan 20, 2026

  • Remove roles.ts and DEFAULT_ROLES (app should own roles)
  • Get roles from context.app.getRoles() at execute time
  • Call context.app.switchRole() instead of globalThis.switchRole
  • Add createToolDefinition(roles) for dynamic enum generation
  • Keep fallback TOOL_DEFINITION for backward compatibility

- Remove roles.ts and DEFAULT_ROLES (app should own roles)
- Get roles from context.app.getRoles() at execute time
- Call context.app.switchRole() instead of globalThis.switchRole
- Add createToolDefinition(roles) for dynamic enum generation
- Keep fallback TOOL_DEFINITION for backward compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@isamu isamu requested a review from snakajima January 20, 2026 03:37
@isamu isamu merged commit f4ed22b into main Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant